//
//  unittest1.c
//  tests the getCost() function in dominion.c with random card inputs
//
//  Created by Preston Skaggs on 1/23/14.
//
//

#include <stdio.h>
#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"
#include <math.h>
#include <stdlib.h>

#define TEST_RUNS 100

int main(){
    int i;
    int test;
    int card;
    enum CARD first = curse;
    enum CARD last = treasure_map;
    int count = 0;
    SelectStream(2);
    PlantSeeds(3);
    for(i=0; i<TEST_RUNS; i++){
        card = (Random()*(last-first))+first;
        test = getCost(card);
        if(test >= 0){
            count++;
        }
        else printf("Invalid card %d\n", card);
    }
    printf("Test OK: %d valid cards checked for cost\n", count);
    return(0);
    
}